<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<html>
	<head>
		<title>前台管理--咨询活动管理</title>				
		<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body,td,th {
	font-size: 9pt;
	color: #666666;
}
body {
	background-color: #CCCCCC;
}
a:link {
	color: #FFFFFF;
	text-decoration: none;
}
a:visited {
	color: #FFFFFF;
	text-decoration: none;
}
a:hover {
	color: #FFFFFF;
	text-decoration: none;
}
a:active {
	color: #FFFFFF;
	text-decoration: none;
}
-->
</style></head>
	<body>	
		<html:form action="/shop/frontMyMessageManage" method="post">
			<input type="hidden" name="method" value="list1" />
			<input type="hidden" name="myMessage.code" value="${myMessage.code}" />	
			<table width="100%" border="0" cellpadding="0" cellspacing="1">
				<logic:present name="MyMessageRange">
					<logic:iterate id="myMessage" name="MyMessageRange" property="records">
						<tr>
						  <td width="100%" height="30" bgcolor="#efefef" class="td_03">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
							<td height="30" bgcolor="#efefef" class="td_03">
								　主题：${myMessage.title}</td>
							<td width="200" height="30" bgcolor="#efefef" class="td_03">
								作者：${myMessage.nicky}</td>
							<td width="200" height="30" bgcolor="#efefef" class="td_03">
								发表时间：${myMessage.publishDate}</td>
						</tr>
                            </table></td></tr>
						<tr>
							<td height="30" colspan=3 bgcolor="#FFFFFF" class="td_03">
								　内容：${myMessage.content}</td>
						</tr>
						<tr>
							<td height="30" colspan=3 class="td_03">
								　管理员回复：${myMessage.reply}</td>
						</tr>
					</logic:iterate>
				</logic:present>
				<logic:present name="MyMessageRange">
				<tr>
					<td height="30" colspan="6" align="left" bgcolor="#999999" style="color:#fff">　<%@ include file="/pages/safeai/jsp/common/page.jsp"%>
&nbsp;&nbsp;&nbsp;&nbsp;				  </td>
				</tr>
				</logic:present>
		  </table>
		</html:form>
		<html:form action="/shop/frontMyMessageManage" method="post">
			<input type="hidden" name="method" value="insert" />
			<table width="10%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">
              <tr>
                <td><table width="10%" border="0" align="center" cellpadding="0" cellspacing="1">
                  <tr>
                    <td height="30" colspan="3" align="center" bgcolor="#CCCCCC" class="td_03"> 添加咨询信息 </td>
                  </tr>
                  <tr bgcolor="#CCCCCC">
                    <td width="80" height="50" align="center" valign="middle" class="td_03"> 昵称 </td>
                    <td height="50" align="center" valign="middle"><input type="text" name="myMessage.nicky" id="nicky" maxlength="40"/style="width:250px;border:1px solid #ddd" />
                    </td>
                    <td width="50" height="50" align="center" valign="middle"> 必填 </td>
                  </tr>
                  <tr bgcolor="#CCCCCC">
                    <td width="80" height="50" align="center" valign="middle" class="td_03"> 联系电话 </td>
                    <td height="50" align="center" valign="middle"><input type="text" name="myMessage.phone" id="phone" maxlength="50"/style="width:250px;border:1px solid #ddd" />
                    </td>
                    <td width="50" height="50" align="center" valign="middle"> 可选 </td>
                  </tr>
                  <tr bgcolor="#CCCCCC">
                    <td width="80" height="50" align="center" valign="middle" class="td_03"> 电子邮件 </td>
                    <td height="50" align="center" valign="middle"><input type="text" name="myMessage.email" id="email" maxlength="50"/style="width:250px;border:1px solid #ddd" />
                    </td>
                    <td width="50" height="50" align="center" valign="middle"> 可选 </td>
                  </tr>
                  <tr bgcolor="#CCCCCC">
                    <td width="80" height="50" align="center" valign="middle" class="td_03"> 标题 </td>
                    <td height="50" align="center" valign="middle"><input type="text" name="myMessage.title" id="title" maxlength="80"/style="width:250px;border:1px solid #ddd" />
                    </td>
                    <td width="50" height="50" align="center" valign="middle"> 必填 </td>
                  </tr>
                  <tr>
                    <td height="30" colspan="3" align="center" bgcolor="#CCCCCC" class="td_03"> *内容 </td>
                  </tr>
                  <tr>
                    <td height="30" colspan="3" bgcolor="#CCCCCC" class="td_03"><textarea name="myMessage.content" id="content" cols="55" rows="4"/style="font-size:9pt;color:#666666;width:500px;height:150px;border:1px solid #ddd"></textarea>
                    </td>
                  </tr>
                  <tr bgcolor="#CCCCCC">
                    <td height="50" colspan="3" align="center"><input type="hidden"/ name="myMessage.code" id="myMessageCode" value="${myMessage.code}" />
                        <input name="submit" type="submit" value="提交信息" onclick="return check()"/>
                    </td>
                  </tr>
                </table></td>
              </tr>
            </table>
		</html:form>
	</body>
</html>
<script language="javascript">
function check(){
 var nicky = document.getElementById("nicky").value;
		  if( nicky==""||nicky==null){
		  alert("请输入昵称");
		  return false;
		  }
		  
		     var phone = document.getElementById("phone").value;
		 if(phone !=null && phone != ''){
		  var pattern = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
                flag = pattern.test(phone);
                if (!flag) {
                    alert("请输入正确的固定电话,如010-63458858或010-63458858-025");

                    return false;
                }			
		}
		
		 var email = document.getElementById("email").value;
		  if( email!=""&&email!=null){
		 		  
		  var pattern = /(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
                flag = pattern.test(email);
                if (!flag) {
                    alert("请填写正确的邮箱！");

                    return false;
                }  
             }   
   var title = document.getElementById("title").value;
		  if( title==""||title==null){
		  alert("请输入主题");
		  return false;
		  }
		  if(document.getElementById("content").value ==""||document.getElementById("content").value==null){
		  alert("请输入内容");
		  return false;
		  }
form.submit();
}
  function gotoPage(pageOffset, pageSize) {
	var form = document.getElementsByTagName("form")[0];
	form.elements["pager.offset"].value = pageOffset;
	form.elements["pageSize"].value = pageSize;
	form.submit();
  }
</script>